﻿/*-------------------------------------
//
//Copyright (C) 2007 开发二组 版权所有。
//
//文件名：Order.cs
//
//文件功能描述：订单打印
// 
//创建标识：2007.11.14 李鹏
//创建描述：
//
//------------------------------------------*/
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using localhost;

public partial class OrderFormManage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            string strOrderID = Convert.ToString(Request.QueryString["OrderInfoID"]);

            DocumentService documentService = new DocumentService();

            gdvProductPreview.DataSource=documentService.GetOrderItem(strOrderID);
            gdvProductPreview.DataBind();

            //同步调用WEB服务,绑定订单的详细信息
            V_OrderInfo orderDetail = documentService.GetOrderDetail(strOrderID);
            this.lblOrderID.Text = orderDetail.OrderInfoID;
            //下单时间
            this.lblOrderDate.Text = orderDetail.CreationTime.ToShortDateString();
            
            //配送方式
            this.lblSendStyle.Text = orderDetail.ShipMethod;
            //支付方式
            this.lblBillStyle.Text = orderDetail.BillMethod;
            //总金额
            this.lblTotal.Text = "￥" + orderDetail.TotalPrice.ToString();
            //购物者姓名
            this.lblPayerName.Text = orderDetail.BillToFirstName + orderDetail.BillToLastName;
            //购物者电话
            this.lblPhone.Text = orderDetail.Phone;
            //收货人姓名
            this.lblInceptName.Text = orderDetail.ShipToFirstName + orderDetail.ShipToLastName;
            //收货人地址
            this.lblAddress.Text = orderDetail.ShipProvince +" "+ orderDetail.ShipCity + " "+orderDetail.ShipAddress;
           
            //收货人邮编
            this.lblPostcode.Text = orderDetail.ShipZip;
            //操作人员
            this.lblCearter.Text = orderDetail.SaleesmanID.ToString();
            //收货人邮箱
            
        }
    }

    void documentService_GetOrderItemCompleted(object sender, GetOrderItemCompletedEventArgs e)
    {
        //绑定订单中的商品数据
        gdvProductPreview.DataSource = e.Result;
        gdvProductPreview.DataBind();
    }
}
